<?php
namespace Admin\Controller;
use Common\Controller\AdminBaseController;
class UserController extends AdminBaseController {
	public function index(){
		$sear=I('post.search');
		$map['uname']=array('LIKE',"%$sear%");
		$count= M('user')->where($map)->count();		
	    $size=8;
	    $this->assign('sear',$sear);
	    $page=ceil($count/$size);
	    $this->assign('show',$page);
		$this->display();	
	}
	public function doindex(){
		$sear=I('get.sear');
		$map['uname']=array('LIKE',"%$sear%");
		$list=M('user')->where($map)->page(I('get.p',1),8)->select();
      	$this->ajaxReturn($list);
	}
	public function edittype(){
		$tid=I('post.ids');	
		$da['type']=I('post.utype');
		$res=M('user')->where("uid = $tid")->save($da);
		if($res){
			$re['status']=true;
		}else{
			$re['status']=false;
		}
		$this->ajaxReturn($re);
	}
	public function dosearch(){

	}

}